﻿#define diffuse
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class Material
{
    public enum Types : int {diffuse=0, refraction=1, mirror=2, texture=3};
    public LightIntensity Ka;
    public LightIntensity Kd;
    public LightIntensity Ks;
    public float Ns;
    public float indexOfRefraction;
    public float reflectionProb;
    public Texture texture;
    public int type; 

    public Material()
    {
        this.Ka = new LightIntensity(0.5, 0.5, 0.5);
        this.Kd = new LightIntensity(0.6, 0.6, 0.6);
        this.Ks = new LightIntensity(1,1,1);
        this.Ns = 10.0f;
        this.indexOfRefraction = 1.52f;
        this.reflectionProb = 0.75f;
        this.type = (int)Types.diffuse;
    }
    public Material(LightIntensity ambient, LightIntensity diffuse, LightIntensity specular)
    {
        this.Ka = ambient;
        this.Kd = diffuse;
        this.Ks = specular;
        this.Ns = 10.0f;
        this.indexOfRefraction = 1.52f;
        this.reflectionProb = 0.75f;
        this.type = (int)Types.diffuse;
    }
    public Material(LightIntensity ambient, LightIntensity diffuse, LightIntensity specular, float Nspec)
    {
        this.Ka = ambient;
        this.Kd = diffuse;
        this.Ks = specular;
        this.Ns = Nspec;
        this.indexOfRefraction = 1.52f;
        this.reflectionProb = 0.75f;
        this.type = (int)Types.diffuse;
    }
    public Material(LightIntensity ambient, LightIntensity diffuse, LightIntensity specular, int type)
    {
        this.Ka = ambient;
        this.Kd = diffuse;
        this.Ks = specular;
        this.Ns = 10.0f;
        this.indexOfRefraction = 1.52f;
        this.reflectionProb = 0.75f;
        this.type = type;
    }
    public Material(Texture tex)
    {
        this.Ka = new LightIntensity(0.2, 0.2, 0.2);
        this.Kd = new LightIntensity(0.8, 1.0, 0.8);
        this.Ks = new LightIntensity(0.8, 0.8, 0.8);
        this.Ns = 10.0f;
        this.indexOfRefraction = 1.52f;
        this.reflectionProb = 0.75f;
        this.texture = tex;
        this.type = 3;
    }
    public Material(LightIntensity ambient, LightIntensity diffuse, LightIntensity specular, float Nspec, float IOR, int type)
    {
        this.Ka = ambient;
        this.Kd = diffuse;
        this.Ks = specular;
        this.Ns = Nspec;
        this.indexOfRefraction = IOR;
        this.reflectionProb = 0.75f;
        this.type = type;
    }
}
